package org.red5.Repository;

import org.red5.daemon.TVideoPara;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public interface VideoRepository extends JpaRepository<TVideoPara, Integer> {
    @Transactional
    @Modifying
    @Query(value = "update t_video_para set video_url =?1 where Id=?2",nativeQuery = true)
    void updateUrlById(String url, int id);

    @Transactional
    @Modifying
    @Query(value = "update t_video_para set video_url =?1 where lan_ipaddr=?2",nativeQuery = true)
    void updateUrlByIp(String url, String lan_ipaddr);

}
